﻿#pragma once 

#include "ComponentBase.h"
#include "stackplate.h"


class StackPlateCheckDIg;
class StackPlateManager : public ComponentBase
{
	Q_OBJECT

public:
	StackPlateManager(QObject *parent);
	~StackPlateManager();

	StackPlate* GetPlate(const QString& id);

	QList<StackPlate*> GetPlateList();
	// 组件初始化处理函数
	virtual int ComponentInit() override;
	/*自检接口*/
	virtual bool ComponentCheckSelfState() override;
	/*复位接口*/
	virtual bool ComponentSelfReset() override;
	virtual void* GetPoint(const QString& id) override;
	virtual bool ExcuteCmd(int cmd, const QByteArray& input, QByteArray& output) override;

private:
	int OnPlateArrive(const QByteArray& data);
	int OnPlateMove(const QByteArray& data);

private:
	std::map<QString, StackPlate*> m_plates;
	StackPlateCheckDIg* m_dlg = nullptr;
};
